chore: fix JavaScript lint errors (issue #11732)#11793
Closed
vedparkasharya wants to merge 2 commits intostdlib-js:developfrom
Closed
chore: fix JavaScript lint errors (issue #11732)#11793vedparkasharya wants to merge 2 commits intostdlib-js:developfrom
vedparkasharya wants to merge 2 commits intostdlib-js:developfrom
Conversation
Replace `new Array(total)` with `[]` to comply with the stdlib/no-new-array ESLint rule.
Closed
Signed-off-by: Athan <kgryte@gmail.com>
kgryte
approved these changes
Apr 26, 2026
Member
|
Ref: #11736 |
Contributor
|
Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit. Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a JavaScript linting error reported in #11732.
Problem
The
entries.jsfile in@stdlib/_tools/pkgs/entry-points/lib/was using thenew Array()constructor, which violates thestdlib/no-new-arrayESLint rule.Error:
Solution
Replaced
new Array( total )with an empty array literal[].Before:
After:
Why this is correct
out[i] = {...}), so JavaScript will automatically grow the array as needed.[]is the idiomatic JavaScript approach and satisfies thestdlib/no-new-arraylint rule.Related Issues
resolves #11732
Checklist